/*     */ package com.lmpop.trade.ti_bidding;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_biddingInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_biddingInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Ti_bidding ti_bidding = new Ti_bidding();
/*  25 */     ti_bidding.setBid_id(map.getString("bid_id"));
/*  26 */     ti_bidding.setCust_id(map.getString("cust_id"));
/*  27 */     ti_bidding.setState_code(map.getString("state_code"));
/*  28 */     ti_bidding.setTitle(map.getString("title"));
/*  29 */     ti_bidding.setCat_attr(map.getString("cat_attr"));
/*  30 */     ti_bidding.setArea_attr(map.getString("area_attr"));
/*  31 */     ti_bidding.setStart_date(map.getString("start_date"));
/*  32 */     ti_bidding.setEnd_date(map.getString("end_date"));
/*  33 */     ti_bidding.setBid_amount(map.getString("bid_amount"));
/*  34 */     ti_bidding.setContent(map.getString("content"));
/*  35 */     ti_bidding.setContact(map.getString("contact"));
/*  36 */     ti_bidding.setPhone(map.getString("phone"));
/*  37 */     ti_bidding.setCellphone(map.getString("cellphone"));
/*  38 */     ti_bidding.setEmail(map.getString("email"));
/*  39 */     ti_bidding.setQq(map.getString("qq"));
/*  40 */     ti_bidding.setMsn(map.getString("msn"));
/*  41 */     ti_bidding.setIn_date(map.getString("in_date"));
/*  42 */     ti_bidding.setUser_id(map.getString("user_id"));
/*  43 */     ti_bidding.setRemark(map.getString("remark"));
/*     */ 
/*  45 */     String result_code = "0";
/*     */     try {
/*  47 */       insert(dbmMgr, ti_bidding);
/*     */     } catch (ApplicationException e) {
/*  49 */       e.printStackTrace();
/*  50 */       result_code = "1";
/*     */     }
/*  52 */     map.setString("result_code", result_code);
/*  53 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_bidding ti_bidding)
/*     */     throws ApplicationException
/*     */   {
/*  62 */     dbmMgr.update("insertTi_bidding", ti_bidding);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  72 */     String pkid_string = map.getString("pkid");
/*  73 */     String result_code = "0";
/*     */     try {
/*  75 */       if (!pkid_string.equals("")) {
/*  76 */         String[] pkStr = pkid_string.split("\\|");
/*  77 */         for (int i = 0; i < pkStr.length; i++) {
/*  78 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  82 */       e.printStackTrace();
/*  83 */       result_code = "1";
/*     */     }
/*  85 */     map.setString("result_code", result_code);
/*  86 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  95 */     dbmMgr.update("deleteTi_bidding", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 104 */     Ti_bidding ti_bidding = new Ti_bidding();
/* 105 */     ti_bidding.setBid_id(map.getString("bid_id"));
/* 106 */     ti_bidding.setCust_id(map.getString("cust_id"));
/* 107 */     ti_bidding.setState_code(map.getString("state_code"));
/* 108 */     ti_bidding.setTitle(map.getString("title"));
/* 109 */     ti_bidding.setCat_attr(map.getString("cat_attr"));
/* 110 */     ti_bidding.setArea_attr(map.getString("area_attr"));
/* 111 */     ti_bidding.setStart_date(map.getString("start_date"));
/* 112 */     ti_bidding.setEnd_date(map.getString("end_date"));
/* 113 */     ti_bidding.setBid_amount(map.getString("bid_amount"));
/* 114 */     ti_bidding.setContent(map.getString("content"));
/* 115 */     ti_bidding.setContact(map.getString("contact"));
/* 116 */     ti_bidding.setPhone(map.getString("phone"));
/* 117 */     ti_bidding.setCellphone(map.getString("cellphone"));
/* 118 */     ti_bidding.setEmail(map.getString("email"));
/* 119 */     ti_bidding.setQq(map.getString("qq"));
/* 120 */     ti_bidding.setMsn(map.getString("msn"));
/* 121 */     ti_bidding.setIn_date(map.getString("in_date"));
/* 122 */     ti_bidding.setUser_id(map.getString("user_id"));
/* 123 */     ti_bidding.setRemark(map.getString("remark"));
/*     */ 
/* 125 */     String result_code = "0";
/*     */     try {
/* 127 */       update(dbmMgr, ti_bidding);
/*     */     } catch (ApplicationException e) {
/* 129 */       e.printStackTrace();
/* 130 */       result_code = "1";
/*     */     }
/* 132 */     map.setString("result_code", result_code);
/* 133 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_bidding ti_bidding)
/*     */     throws ApplicationException
/*     */   {
/* 142 */     dbmMgr.update("updateTi_bidding", ti_bidding);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 152 */     Map ti_bidding = (Hashtable)obj;
/* 153 */     if (start == 0)
/* 154 */       start = 0;
/*     */     else {
/* 156 */       start = (start - 1) * limit;
/*     */     }
/* 158 */     ti_bidding.put("start", Integer.valueOf(start));
/* 159 */     ti_bidding.put("limit", Integer.valueOf(limit));
/* 160 */     return this.queryList.getList("getListByTi_biddingPage", ti_bidding);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 171 */     Map ti_bidding = (Hashtable)obj;
/* 172 */     List list = this.queryList.getList("getCountByObjTi_bidding", obj);
/* 173 */     int count = 0;
/* 174 */     if ((list != null) && (list.size() > 0)) {
/* 175 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 176 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 177 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 180 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 190 */     return this.queryList.getList("getTi_biddingByPk", pk);
/*     */   }
/*     */ 
/*     */   public SysMap updateState(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 200 */     Map state_code_map = new Hashtable();
/* 201 */     String pkid_string = map.getString("pkid");
/* 202 */     String state_code = map.getString("up_operating");
/* 203 */     state_code_map.put("state_code", state_code);
/* 204 */     String result_code = "0";
/*     */     try {
/* 206 */       if (!pkid_string.equals("")) {
/* 207 */         String[] pkStr = pkid_string.split("\\|");
/* 208 */         for (int i = 0; i < pkStr.length; i++)
/* 209 */           if (!pkStr[i].equals("")) {
/* 210 */             state_code_map.put("bid_id", pkStr[i]);
/* 211 */             updateState(dbmMgr, state_code_map);
/*     */           }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 217 */       e.printStackTrace();
/* 218 */       result_code = "1";
/*     */     }
/* 220 */     map.setString("result_code", result_code);
/* 221 */     return map;
/*     */   }
/*     */ 
/*     */   public void updateState(DbmInterf dbmMgr, Map state_code_map)
/*     */     throws ApplicationException
/*     */   {
/* 230 */     dbmMgr.update("updateTi_bidding_state", state_code_map);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_bidding.Ti_biddingInfo
 * JD-Core Version:    0.6.0
 */